﻿#region Copyright © Marian Placko 2010-2011
//
// All rights are reserved. Reproduction or transmission in whole or in part,
// in any form or by any means, electronic, mechanical or otherwise, is
// prohibited without the prior written consent of the copyright owner.
//
#endregion

using System.Reflection;

namespace MarianPlacko.SqlSmartSecurity
{
    /// <summary>
    /// The class of an encryption.
    /// </summary>
    public class Encryption
    {
    }
    
    /// <summary>
    /// The class of an about.
    /// </summary>
    internal static class About
    {
        /// <summary>
        /// The assembly product property.
        /// </summary>
        internal static string AssemblyProduct
        {
            get
            {
                var attributes =
                    Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyProductAttribute),
                                                                        false);
                return attributes.Length == 0 ? string.Empty : ((AssemblyProductAttribute) attributes[0]).Product;
            }
        }

        /// <summary>
        /// The assembly version property.
        /// </summary>
        internal static string AssemblyVersion
        {
            get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
        }

        /// <summary>
        /// The assembly copyright property.
        /// </summary>
        internal static string AssemblyCopyright
        {
            get
            {
                var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(
                    typeof (AssemblyCopyrightAttribute), false);
                return attributes.Length == 0 ? string.Empty : ((AssemblyCopyrightAttribute) attributes[0]).Copyright;
            }
        }

        /// <summary>
        /// The assembly description property.
        /// </summary>
        internal static string AssemblyDescription
        {
            get
            {
                var attributes =
                    Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyDescriptionAttribute), false);
                return attributes.Length == 0 ? string.Empty : ((AssemblyDescriptionAttribute) attributes[0]).Description;
            }
        }
    }
}